package goods

import (
	"fmt"
	"github.com/gin-gonic/gin"
	goodsRep "shopstar/forms/api/goods"
	"shopstar/reponse"
	goodsResp "shopstar/reponse/goods"
	"strconv"
	//goodsRep "traning/node3/shopstar/forms/api/goods"
)

func GetGoodsSku(ctx *gin.Context) {
	goodsId, _ := strconv.Atoi(ctx.Query("goods_id"))
	data := SkuService.CateList(int64(goodsId))
	reponse.OKWithData(goodsResp.AttributeDetail{
		data,
	}, ctx)
}

func SkuTbDetail(ctx *gin.Context) {
	var req goodsRep.GoodsSku

	ctx.ShouldBind(&req)
	fmt.Println(req)

	reponse.OKWithData(goodsResp.SkuTbdetail{
		Data: SkuService.SkuAttrCollection(req.GoodsId, req.SkuPrperties),
	}, ctx)
}
